import request from '@/utils/request'

// todo 分页查询回车登记列表
export function getBackList(data) {
  return request({
    url: '/manager/truck-return-register/pageQuery',
    method: 'post',
    data
  })
}

// todo 获取车辆详情
export function getTruckDetail(id) {
  return request({
    url: `/manager/truck/${id}`,
    method: 'get'
  })
}

// todo 获取未绑定车辆的司机
export function getDriverList() {
  return request({
    url: '/manager/unBindingDrivers/',
    method: 'GET'
  })
}

// todo 车辆绑定司机
export function bindDriver(driverIds, truckId) {
  return request({
    url: '/manager/truck/truckDrivers',
    method: 'post',
    data: {
      driverIds,
      truckId
    }

  })
}

// todo 获取绑定司机
export function getBindDriver(truckId) {
  return request({
    url: `/manager/bindingDrivers/${truckId}`,
    method: 'get'
  })
}
